<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .con {
            width: 400px;
            height: 400px;
            background-color: gold;
            margin: 100px auto 0;
            transition: all 1s ease;
            transform: perspective(800px) rotateY(0);
            transform-style: preserve-3d;
        }

        .box {
            transform-style: preserve-3d;
            width: 300px;
            height: 300px;
            background-color: blue;
            transition: all 1s ease;
            transform: perspective(800px) rotateY(0);
        }

        .con:hover {
            transform: perspective(800px) rotateY(60deg);
        }

        .con:hover .box {
            transform: perspective(800px) rotateY(-60deg);
        }
    </style>
</head>

<body>
    <div class="con">

        <div class="box">



        </div>
    </div>


</body>

</html>